package com.woniu.product.client;

import com.woniu.product.client.result.CouponResultInfo;
import com.woniu.product.client.result.ReceiveRecordResultInfo;
import com.woniu.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(contextId = "couponQueryClient", name = "product")
public interface CouponQueryClient {

    //查看优惠券领取记录
    @GetMapping("receiveRecord")
    public Result receiveRecord(@RequestParam("userId") Integer userId, @RequestParam("state") String state);

    /**
     * 根据优惠券领取Id查询信息
     *
     * @param receiveRecordId
     * @return
     */
    @GetMapping("serachCuponByCouponReceiveId")
    public Result<ReceiveRecordResultInfo> serachCuponByCouponReceiveId(@RequestParam("receiveRecordId") Integer receiveRecordId);

    /**
     * 查询skuId可使用的券
     * @param skuId
     * @return
     */
    @GetMapping("searchCouponBySkuId")
    public Result<List<CouponResultInfo>> searchCouponBySkuId(@RequestParam("skuId") Integer skuId);

    /**
     * 根据couponId查询优惠券信息
     * @param couponId
     * @return
     */
    @GetMapping("searchCouponByCouponId")
    public Result<CouponResultInfo> searchCouponByCouponId(@RequestParam("couponId") Integer couponId);

}
